package com.example.demo.controller;



import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.example.demo.entity.Competition;
import com.example.demo.service.DcMainService;
//用于处理跳转到用户赛事主页面的Controller
@RestController
public class CompDcMainController {
	@Autowired
	private DcMainService dcMainService;
	@RequestMapping("/DcGetCompetition")
	public ModelAndView getCompetitioninfo() {
		List<Competition> competitions=dcMainService.getAllCompetitionInfo();
		ModelAndView mv=new ModelAndView();
		mv.setViewName("CompDcMain.html");
		mv.addObject("competitions", competitions);
		return mv;
}
	
}